import Vue from 'vue'
import VueRouter from "vue-router"
import App from "../App"
import UserList from "../user/UserList"
import UserDetail from "../user/UserDetail"
import Sql from "../Sql";

Vue.use(VueRouter)

const router = new VueRouter({
    routes: [
        {
            path: '/',
            component: App,
            redirect: '/user/list',
            name: 'User',
            alwaysShow: true,
            meta: {title: '用户管理'},
            children: [
                {path: 'user/list', component: UserList, meta: {title: '用户列表'}},
                {path: 'user/detail/:id(\\d+)', component: UserDetail, props: true, meta: {title: '用户详情'}},
                {path: 'user/sql', component: Sql, meta: {title: 'Sql查询'}}
            ]
        },
    ]
})

export default router
